package file;

import java.io.File;
import java.io.IOException;

/** File的演示 */
public class FileDemo {
    public static void main(String[] args) throws IOException {
        File file = new File("./demo.txt");
        String name = file.getName();
        System.out.println(name);
        System.out.println(file.canRead());
        boolean cw = file.canWrite();
        System.out.println("是否可读："+cw);
        System.out.println("文件大小："+file.length());
        System.out.println("是否隐藏："+file.isHidden());
        boolean IF = file.isFile();
        System.out.println("是否是文件："+IF);



    }
}
